 #ifndef PAINTAREA_H
 #define PAINTAREA_H

#include <QColor>
#include <QImage>
#include <QPainterPath>
#include <QPainter>
#include <QWidget>
#include <QMouseEvent>
#include <QCursor>


 class BrushInterface;

 class PaintArea : public QWidget
 {
     Q_OBJECT

 public:
		 ~PaintArea();
		PaintArea(QWidget *parent = 0);
		bool openImage(const QString &fileName);
		bool saveImage(const QString &fileName, const char *fileFormat);
		void setImage(const QImage &image);
		void insertShape(const QPainterPath &path);
		void setBrush(BrushInterface *brushInterface, const QString &brush);
		QImage* getImage()  { return &theImage; }
		void resizeImage( QSize);
		int getUndoPointer() const {return undoPointer;}
		QPoint getLastPoint() const {return lastPoint; }
		void setLastPoint(QPoint newPoint) {lastPoint = newPoint;}
		void setScribbling(bool value){scribbling = value;}
		QSize sizeHint() const;
		void undo();
		void redo();
		void saveUndoState();
		void cleanUndoStack();
	    const QString getCurrentTool();
		void incrementZoomLevel(){++currentZoomLevel;}
		int getZoomLevel() const {return currentZoomLevel;}
		void setCursor(QCursor cShape){this->setCursor(cShape);}

 protected:
     void paintEvent(QPaintEvent *);
     void mousePressEvent(QMouseEvent *);
     void mouseMoveEvent(QMouseEvent *);
     void mouseReleaseEvent(QMouseEvent *);
	 
 private:
	 int currentZoomLevel;
	 int undoPointer;
     bool modified;
     bool scribbling;
     QImage theImage;
     QPoint lastPoint;
	 std::vector<QImage*> undoVector;
 };

 #endif